function sum(a:number, b:number): number{
  return a + b;
}

console.log(sum(1 , 2))


function getUserInfo(name: string, age:number, gender?: string){
  if(gender === undefined){
    gender = '未知'
  }
  return `name=${name},age=${age},gender=${gender}`;
}

console.log(getUserInfo('张三', 28))
console.log(getUserInfo('张三', 28, '女'))


function getUserInfo02(name: string, age:number, gender: string='男'){
  if(gender === undefined){
    gender = '未知'
  }
  return `name=${name},age=${age},gender=${gender}`;
}

console.log(getUserInfo02('张三', 28))
console.log(getUserInfo02('张三', 28, '女'))


const d: number | string ='1'
console.log(d)

const b: any = 'c'
console.log(b)

const arr:number[] = [1,2,3,4,5]

arr.forEach(item => console.log(item));
